<template>	
	<div class="card mb-0" id="bill-detail-change" v-if="detailInfo !== undefined && detailInfo !== null && detailInfo.changeOrders.length > 0">
          <div class="card-header" v-if="!hideLabel">改签明细</div>
      
          <table class="table table-striped table-hover table-sm mb-0">
            <thead v-if="!hideLabel">
                <tr>
                    <th>票号</th>
                    <th>乘客</th>
                    <th class="text-center bg-info text-white" colspan="7">行程</th>
                    <th>销售价</th>
                    <th>税</th>
                    <th>航司收费</th>
                    <th>服务费</th>
                    <th>利润</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
              <template  v-for="info in detailInfo.changeOrders">
                <tr :key="info.id">   
                    <td>{{info.balanceCode}}-{{(info.ticketNo)}}</td>                             
                    <td>
                        {{info.psgName}}
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          <span v-if="flt.flightType === 0">前：</span> 
                          <span v-else>后：</span> 
                          {{flt.flightNo}}
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          {{flt.subclass}}
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          <small class="text-success">{{flt.departureAirport}}{{flt.departureAirportName}} {{flt.departureTerminal}}</small>
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          <small class="text-success">{{flt.arrivalAirport}}{{flt.arrivalAirportName}} {{flt.arrivalTerminal}}</small>
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          {{flt.departureDate}}
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          {{flt.departureTime}}
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>
                    <td>
                        <template v-for="(flt, index) in info.flights">
                          {{flt.arrivalTime}}
                          <template v-if="index < info.flights.length - 1 "><br/></template>
                        </template>
                    </td>   
                    <td>{{info.parvalue}}</td>
                    <td>{{info.tax}}</td>
                    <td>{{info.airChangeCharge}}</td>
                    <td>{{info.serviceCharge}}</td>
                    <td>{{info.serviceCharge}}</td>
                    <td></td>
                </tr>
              </template>
            </tbody>
          </table>
  </div>
</template>

<script>
  export default {
    props: {
      detailInfo: {
        type: Object
      },
      hideLabel: {
        type: Boolean,
        default: false
      }
    }
  }		
</script>